//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Runtime.InteropServices;
using STATSTG=System.Runtime.InteropServices.ComTypes.STATSTG;

namespace OpenLS.Spreadsheet.Formats.Biff
{
    using _ULARGE_INTEGER = UInt64;
    using STREAM_SEEK = Int32;

    [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("0000000C-0000-0000-C000-000000000046")]
    internal interface IStream
    {
        int Read([MarshalAs(UnmanagedType.LPArray)] byte[] pv, uint cb, ref uint pcbRead);
        int Write([MarshalAs(UnmanagedType.LPArray)] byte[] pv, uint cb, ref uint pcbWritten);
        int Seek(long dlibMove, Int32 dwOrigin, ref ulong plibNewPosition);
        int SetSize(UInt64 libNewSize);
        int CopyTo(IStream pstm, UInt64 cb, ref UInt64 pcbRead, ref UInt64 pcbWritten);
        int Commit(uint grfCommitFlags);
        int Revert();
        int LockRegion(UInt64 libOffset, UInt64 cb, uint dwLockType);
        int UnlockRegion(UInt64 libOffset, UInt64 cb, uint dwLockType);
        int Stat(ref STATSTG pstatstg, uint grfStatFlag);
        int Clone(ref IStream ppstm);
    }
}